from selenium.webdriver.common.by import By


class FindSourcePage:

    # 找资源页面章节下资源数
    find_source_num = (By.CSS_SELECTOR, '.bk-list-tip span[style="color: rgb(29, 141, 243);"]')

    # 找资源页面删除按钮数量
    find_sources_delete_btn = (By.CSS_SELECTOR, '.bk-span-btn.item')

    # 找资源页面类型课件
    find_source_type = (By.XPATH, '//div[@class="bk-form-item"]//button[contains(text(),"课件")]')

    # 找资源页面资源等级
    find_source_level = (By.CSS_SELECTOR, '.popover-filter.level')

    # 切换等级到普通
    change_level_point = (By.CSS_SELECTOR, '.el-popover.el-popper.level li[title="普通"]')

    # 资源列表资源价格标签
    source_list = (By.CSS_SELECTOR, '.bk-list-sub i[style="font-style: normal;"]')

    # 资源列表资料数
    source_list_num = (By.CSS_SELECTOR, "//li[contains(text(),'浏览')]/ancestor::ul/following-sibling::p/span[@class]")

    # 章节切换 #pane-resources .chapter
    source_list_chapter = (By.CSS_SELECTOR, '#pane-resources .chapter')

    # 资源列表筛选切换到浏览
    source_list_sort = (By.XPATH, "//li[contains(text(),'浏览')]")

    # 学科网资源列表可加备课资源数
    sources_list_bk_num = (By.XPATH, '//div[@id="pane-resources"]//button[contains(text(),"＋ 备课")]')

    # 题库切换按钮
    questions_btn = (By.CSS_SELECTOR, '#tab-questions')

    # 题库题型切换到选择题
    questions_type = (By.XPATH, "//button[contains(text(),'选择题')]")

    # 试题收起解析按钮
    questions_Parsing_btn = (By.XPATH, "//span[contains(text(),'收起解析')]")

    # 试题查看解析按钮
    questions_look_Parsings_btn = (By.XPATH, "//span[contains(text(),'查看解析')]")

    # 试题加备课按钮
    questions_list_bk_btn = (By.XPATH, '//div[@id="pane-questions"]//button[contains(text(),"+ 备课")]')

    # 试题加试卷按钮
    questions_list_st_btn = (By.XPATH, '//div[@id="pane-questions"]//span[contains(text(),"+ 试卷")]')

    # 试题加成功后 - 试卷按钮
    questions_list_st_success_btn = (By.XPATH, '//div[@id="pane-questions"]//span[contains(text(),"- 试卷")]')

    # 试题篮试题数
    bk_basket_num = (By.CSS_SELECTOR, '.bk-basket-num span')

    # 试题篮按钮
    bk_basket = (By.CSS_SELECTOR, '.bk-svg-basket.el-popover__reference')

    # 清空试题篮
    delete_basket = (By.XPATH, "//button[contains(text(),'清空试题')]")

    # 清空试题确定按钮
    delete_basket_conform = (By.XPATH, '//div[contains(text(),"清空试题篮中的试题吗")]/ancestor::div['
                                       '@class="el-dialog__body"]/following-sibling::div//button[text()="确定"]')

    # 生成试卷按钮
    product_basket = (By.XPATH, "//button[contains(text(),'生成试卷')]")

    # 试题篮加备课按钮
    basket_add_bk = (By.XPATH, "//button[contains(text(),'+ 备课')]")
